import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston';
import { NestExpressApplication } from '@nestjs/platform-express';
import { FormatterInterceptor } from './formatter.interceptor';
async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.useStaticAssets('public')
  app.enableCors()
  app.useGlobalPipes(new ValidationPipe())
  app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER))
  // 响应拦截器
  // app.useGlobalInterceptors(new FormatterInterceptor())
  await app.listen(3000);
}
bootstrap();
